home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 29
/
Volume 29 - JOGO DISK .iso
/
Games
/
jungle_adventure.swf
/
scripts
/
__Packages
/
Checkpoint.as
< prev
next >
Wrap
Text File
|
2006-11-29
|
1KB
|
59 lines
class Checkpoint extends SSObject
{
var classID = SSGlobal.CLSID_CHECKPOINT;
var assetID = "Checkpoint";
var soundID = "Checkpoint";
var checkpointID = 0;
var depthLayer = 1;
var collected = false;
var editor_isItem = true;
var editor_name = "Checkpoint";
var editor_args_names = ["id"];
var editor_args_values = [Checkpoint.prototype.checkpointID];
var editor_args_types = ["number"];
var editor_args_options = [[0,1000,1]];
var editor_args_descriptions = [""];
var editor_args_mode = [0];
var editor_args_component = ["NumericStepper"];
var editor_canChangeFrame = false;
function Checkpoint(id, visible)
{
super();
if(id)
{
this.checkpointID = id;
}
}
function onAddToWorld()
{
this.world.addObject(this.zone = new SSZone(SSZone.SPHERE,20,this.zone_onCollide,this));
this.zone.moveBy(this.x,this.y,this.z);
}
function zone_onCollide(obj)
{
this.setCollected(obj);
}
function onAddDisplay()
{
if(this.collected)
{
this.target.gotoAndStop(this.target._totalframes);
}
else
{
this.target.gotoAndStop(1);
}
}
function setCollected(obj)
{
if(this.collected)
{
return undefined;
}
obj.setRestorePoint(this);
this.collected = true;
GameSound.playSound(this.soundID);
this.target.play();
}
}